let list = [8, 1, 1, 2, 4, 2, 6, 3, 4, 3, 1, 2]

// 1
let set = new Set(list)
console.log(Array.from(set));

// 2
let arr1 = list.sort();
let arr2 = []
for (let i = 0; i < arr1.length; i++) {
   if (arr1[i] == arr1[i + 1]) {
      continue
   }
   arr2.push(arr1[i])
}
console.log(arr2);

// 3
let arr3 = []
for (let i of list.keys()) {
   if (arr3.indexOf(list[i]) == -1) {
      arr3.push(list[i])
   }
}
console.log(arr3);

// 4
let arr4 = []
for (let i of list.keys()) {
   if (arr4.includes(list[i]) == 0) {
      arr4.push(list[i])
   }
}
console.log(arr4);

// 5
let obj = {}
let arr5 = []
for (let i = 0; i < list.length; i++) {
   if (!obj[list[i]]) {
      obj[list[i]] = 'jkl';
      arr5.push(list[i])
   }
}
console.log(arr5);